import("System")
import("System.Text")
import("System.IO.Ports")

mport = SerialPort()
mport.PortName = "com1"
mport.Parity = Parity.None
mport.StopBits = StopBits.One
 
mport:Open()
buffer = Encoding.ASCII:GetBytes("aabb")
Info(buffer.Length)
mport:Write(buffer,0,buffer.Length)
mport:Close()